classDiagram
    class State {
        <<interface>>
        +handle(context: Context): void
    }
    class ConcreteStateA {
        +handle(context: Context): void
    }
    class ConcreteStateB {
        +handle(context: Context): void
    }
    class Context {
        -state: State
        +setState(state: State): void
        +request(): void
    }
    class Client {
        -context: Context
    }

    State <|.. ConcreteStateA
    State <|.. ConcreteStateB
    Context o-- State : has a
    Client --> Context : uses
